package demo12;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sr=new Scanner(System.in);
        String s=sr.nextLine();
        int sum=0;
        for (int i = 0; i < s.length(); i++) {
            sum=sum+(int)(s.charAt(i)-'0');
        }
        System.out.println(sum);
    }
}
